home *** CD-ROM | disk | FTP | other *** search
/ Experimental BBS Explossion 3 / Experimental BBS Explossion III.iso / os2 / wuz11a.zip / WPSET.CMD < prev    next >
OS/2 REXX Batch file  |  1993-12-14  |  860b  |  35 lines

  1. /* Rexx program to set object data */
  2. /* (c) Copyright 1993 Scott Maxwell. */
  3.  
  4. arg args
  5. split = LastPos(" ",args)
  6. where = Left(args,split-1)
  7. data = SubStr(args,split+1)
  8. if Left(where,1) = '"' then
  9.   where = SubStr(where,2,Length(where)-2)
  10.  
  11. if where = '' | data = '' then do
  12.   say "Usage: WPSet object-name object-data"
  13.   say "       Use this to set object data.  For instance, to open a folder use:"
  14.   say "       WPSet c:\os2 open=default"
  15.   exit(0)
  16. end
  17.  
  18. call RxFuncAdd 'SysSetObjectData','RexxUtil','SysSetObjectData'
  19. if SysSetObjectData(where,data) = 0 then do
  20.   say 'Error creating object'
  21.   exit(1)
  22.   end
  23.  
  24. exit(0)
  25.  
  26. Directory: procedure
  27.   arg Name
  28.   if Length(Name) > 3 then
  29.     if Right(Name,1) = '\' then
  30.       Name = Left(Name,LENGTH(Name)-1)
  31.   n = 'DIRECTORY'(Name)
  32.   if Right(n,1) \= '\' then
  33.     n = n'\'
  34.   return n
  35.